<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<title>处理结果保存</title>
</head>
<style>
.msgBox .tableForm th{ width:60px;}
</style>
<body>
	<div id="wrap">
    	<div id="public_head"></div>
<div class="msgBox">
<h2>客户咨询</h2>
<div class="bc">
<form action="" id='ajax-form' method='post'>
<table class="tableForm" width="410px" border="0">
	<tr>
		<th height="35" width="60">科室：</th>
		<td>
		<select name='deptype' class="select">
			<option value="1" <?php if($row['DEP_TYPE'] == 1)echo ' selected ';?>>门诊科室</option>
			<option value="2" <?php if($row['DEP_TYPE'] == 2)echo ' selected ';?>>住院科室</option>
		</select>
		<select class="select deptype" deptype='1' name="" style='display:none;'>
<?php 
			$allmzdep = JYDep::getMzDepts(CSM_UNIT_ID);
				if(is_array($allmzdep) && count($allmzdep)>0){
					foreach ($allmzdep as $k=>$v){
?>
			<option value="<?php echo $v['DEP_NO'];?>" <?php if($row['DEP_NO'] == $v['DEP_NO'])echo 'selected'?>><?php echo $v['DEP_NAME'];?></option>
<?php 
		}
	}else{
?>
			<option>还没有科室可选择</option>
<?php }?>
		</select>
			<select class="select deptype" deptype='2' name="" style='display:none;'>
			<?php 
				$allzydep = JYDep::getZyDepts(CSM_UNIT_ID);
				if(is_array($allzydep) && count($allzydep)>0){
					foreach ($allzydep as $k=>$v){
			?>
				<option value="<?php echo $v['DEP_NO'];?>" <?php if($row['DEP_NO'] == $v['DEP_NO'])echo 'selected'?>><?php echo $v['DEP_NAME'];?></option>
			<?php 
					}
				}
			?>
			</select>		
		</td>
	</tr>
	<tr>
		<th height="35">标题：</th>
		<td><input type="text" name="title" style="width:200px" class="qi_text" value="<?php echo $row['TITLE']?>"/></td>
	</tr>
	<tr>
		<th height="35">公开：</th>
		<td>
			<input type="radio" name="type" value='1' <?php if($row['TYPE'] == 1)echo ' checked '?>/> 公开
			<input type="radio" name="type" value='2' <?php if($row['TYPE'] == 2)echo ' checked '?>/> 内部公开
		</td>
	</tr>
	<tr>
		<th style="vertical-align: top;">内容：</th>
		<td><textarea class="textarea" name="content" style="height: 100px;width: 260px;" cols="2" rows="10"><?php echo $row['CONTENT']?></textarea></td>
	</tr>
	<tr>
		<th height="35">&nbsp;</th>
		<td>
			<input class="btn_gray" name="sub_ask" type="submit" value="提 交" />
			<input class="btn_gray" name="sub_btn" type="button" onclick="history.back()" value="返 回" />
			<span class='red' id='msg'></span>
		</td>
	</tr>
</table></form>
</div>
</div>
</div>
</body>
</html>
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<script src="/js/boot.js"></script>
<script src="/js/tip.js"></script>
<script src="/js/comm.js"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>
<script type="text/javascript">
var index = $('select[name="deptype"]').val()
	$('select.deptype').each(function(){
		$(this).attr('name','');
		$(this).hide();
		if(index == $(this).attr('deptype')){
			$(this).attr('name','depid');
			$(this).show();
		}
	})
$('select[name="deptype"]').change(function (){
	var type = $(this).val()
	$('select.deptype').each(function(){
		$(this).attr('name','');
		$(this).hide();
		if(type == $(this).attr('deptype')){
			$(this).attr('name','depid');
			$(this).show();
		}
	})
})
$('input[name="sub_ask"]').click(function(){
	var t = this
	var depid = $('select[name="depid"]').val()
	var type = $('input[name="type"]').val()
	var title = $('input[name="title"]').val()
	var con = $('textarea[name="content"]').val()
//	if(t.cursor=='wait'){return false;}
	t.cursor = 'wait'
	if(title == '' || $.trim(title)==''){
		$('#msg').html('标题不能为空')
		t.cursor = 'pointer'
		return false;
	}
	if(con == '' || $.trim(con)==''){
		$('#msg').html('咨询内容不能为空')
		t.cursor = 'pointer'
		return false;
	}
})
</script>